let test = [1,2,3,undefined]
/**
 * //filter返回原数组通过callback的元素组成的新数组
 * @param {*} callback 
 * @param {*} that 
 */
Array.prototype.myFilter = function(callback,that){
    let arrThis = that||this
    let newArray=[],
        j=0
    for(let i=0;i<arrThis.length;i++){
        if(callback(this[i],i,this)){
            newArray[j++]=this[i]
        }
    }
    return newArray
} 
console.log(undefined>0);
console.log(test.myFilter(item=>item>0?true:false));